package BasicKnowledge.Basic.IO;

import java.io.File;
import java.io.IOException;

/**
 * @time: 2021/2/2/002 21:48
 * @author: Zhurunhe
 */
public class Demo12 {
    public static void main(String[] args) throws IOException {
        File file=new File("G:/newFile");
        file.mkdir(); //创建文件夹

        File file1=new File("G:/newFile","newfile");
        file1.createNewFile();

        File f2=new File("G:/print.txt");
        System.out.println(f2.getName());

        String path="G://英雄联盟";
        testFileList(path);
    }

    private static void testFileList(String path) {
        File file=new File(path);
        String[] subs=file.list();

        for (String s:subs){
            System.out.println(s);
        }

    }
}
